package com.zastoupil.pgc.blueprint_pattern.xml;

import java.util.List;
import java.util.Set;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

/**
 * <p>
 * A Modifier object is structurally identical to a {@link Blueprint} object but
 * is functionally quite different. In fact, the functional difference is so
 * important that the decision to define a Modifier as a different class type
 * than Blueprint was made to enforce differences in functionality via the java
 * compiler and JAXB framework.
 * </p>
 * <p>
 * A Modifier is a set of instructions for a {@link Factory} object to use in
 * altering the instruction set provided by a Blueprint object.
 * </p>
 * <p>
 * The fields of a Modifier object correspond directly to the XML file structure
 * associated with it, and are detailed here:
 * <ul>
 * <li>
 * <b><code>String name</code></b>
 * <p>
 * This is the name of the modifier, which can be used in variable calls within
 * expressions used in {@link Property} <code>value</code> and {@link Factory}
 * <code>modifierList</code> strings.
 * </p>
 * </li>
 * <li>
 * <b><code>List propertyList</code></b>
 * <p>
 * This is a list of {@link Property} objects that represent the instructions
 * for modifying a Blueprint object.
 * </p>
 * </li>
 * <li>
 * <b><code>Set domainSet</code></b>
 * <p>
 * This is a set of strings that each represent a domain or "type" to which this
 * modifier belongs.
 * </p>
 * </li>
 * </ul>
 * </p>
 * 
 * @author Peter Zastoupil
 * 
 */
@XmlRootElement(name = "modifier")
@XmlType(propOrder = { "name", "propertyList", "domainSet" })
public class Modifier {

	private String name;

	private List<Property> propertyList;

	private Set<String> domainSet;

	public String getName() {
		return name;
	}

	@XmlElement(name = "name")
	public void setName(String name) {
		this.name = name;
	}

	public List<Property> getPropertyList() {
		return propertyList;
	}

	@XmlElementWrapper(name = "propertyList")
	@XmlElement(name = "property")
	public void setPropertyList(List<Property> propertyList) {
		this.propertyList = propertyList;
	}

	public Set<String> getDomainSet() {
		return domainSet;
	}

	@XmlElementWrapper(name = "domainSet")
	@XmlElement(name = "domain")
	public void setDomainSet(Set<String> domainSet) {
		this.domainSet = domainSet;
	}

}
